package springboot.druid.mybatisplus.demo.services.impls;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import springboot.druid.mybatisplus.demo.entities.SysUser;
import springboot.druid.mybatisplus.demo.mappers.SysUserMapper;
import springboot.druid.mybatisplus.demo.services.StockService;
import springboot.druid.mybatisplus.demo.services.SysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.beans.Transient;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author metka499
 * @since 2020-06-24
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements SysUserService {

    @Autowired
    private StockService stockService;

    @Transactional(propagation = Propagation.REQUIRED)
    public boolean del(Integer id){
       this.baseMapper.deleteById(id);


       stockService.del(id);

        int a = 1/0;

       return true;
    }
}
